Statistics Functions:
<?php
/*
mysql_query("DELETE FROM `temp_stat` WHERE `id`>'-1'") or die(mysql_error()); // because this table is temporary, we should make sure it's tabula rasa when we use it.

$stat_query = "SELECT * FROM `airplay` WHERE `status`='2' AND `cddbid`!='' ";
$stat_result = mysql_query($stat_query);
while($stat_row = mysql_fetch_assoc($stat_result)) {
	$temp_query = "SELECT * FROM `temp_stat` WHERE `cdid`='".$stat_row[cddbid]."' LIMIT 1";
	$temp_result = mysql_query($temp_query) or die(mysql_error());	
	if ($temp_row = mysql_fetch_assoc($temp_result)) {
		$spins = $temp_row[spins];
		$spins++;
		mysql_query("UPDATE `temp_stat` SET `spins`='".$spins."' WHERE `cdid`='".$stat_row[cddbid]."' ") or die(mysql_error());
	} else {
		mysql_query("INSERT INTO `temp_stat` SET `spins`='1', `cdid`='".$stat_row[cddbid]."' ") or die(mysql_error());
	}
}
?>
<table><tr><td>Rating</td><td>Spins</td><td>Slot</td></tr>
<?php
$rating = 0;
$statistics_query = "SELECT * FROM `temp_stat` ORDER BY `spins` DESC";
$statistics_result = mysql_query($statistics_query) or die(mysql_error());
while ($statistics_row = mysql_fetch_assoc($statistics_result)) {
?>
<tr><td><?=++$rating?></td><td><?=$statistics_row[spins]?></td><td><?=mysql_result(mysql_query("SELECT `artist` FROM `album` WHERE `cddbid`='".$statistics_row[cdid]."' "), 0) ?></td></tr>
<?php
}
?>
</table>
<?php
*/
echo(mysql_query("SELECT COUNT(DISTINCT LOWER(`artist`)) FROM `airplay` "));
?>